// *Author：jxx
// *Contact：283591387@qq.com
// *代码由框架生成,任何更改都可能导致被代码生成器覆盖
import { useOrderStore } from '@/store/useOrderStore'

const orderStore = useOrderStore()
// 假设 tableData 是你的工单台账数据
orderStore.setOrders(table)

export default function(){
    const table = {
        key: 'Id',
        footer: "Foots",
        cnName: '工单台账表',
        name: 'TicketsLedger',
        url: "/TicketsLedger/",
        sortName: "Id"
    };
    const tableName = table.name;
    const tableCNName = table.cnName;
    const newTabEdit = false;
    const key = table.key;
    const editFormFields = {"documentcode":"","BomCode":"","plannedquantity":"","Plannedtarttime":"","State":"","craft":"","alreadyproduced":"","unqualifiedquantity":"","CreateTime":""};
    const editFormOptions = [[{"title":"工单编号","required":true,"field":"documentcode"}],
                              [{"title":"BOM编码","required":true,"field":"BomCode"}],
                              [{"title":"计划数量","required":true,"field":"plannedquantity","type":"number"}],
                              [{"title":"计划开始时间","required":true,"field":"Plannedtarttime"}],
                              [{"title":"订单状态","required":true,"field":"State","type":"number"}],
                              [{"title":"工艺线路","required":true,"field":"craft"}],
                              [{"title":"已经生产","required":true,"field":"alreadyproduced"}],
                              [{"title":"不合格数量","required":true,"field":"unqualifiedquantity","type":"number"}],
                              [{"title":"创建时间","required":true,"field":"CreateTime"}]];
    const searchFormFields = {"State":"","CreateTime":""};
    const searchFormOptions = [[{"title":"工单编号","field":"documentcode"}],[{"title":"订单状态","field":"State","type":"number"}],[{"title":"创建时间","field":"CreateTime"}]];
    const columns = [{field:'Id',title:'主键',type:'int',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'documentcode',title:'工单编号',type:'string',width:110,require:true,align:'left'},
                       {field:'BomCode',title:'BOM编码',type:'string',width:110,require:true,align:'left'},
                       {field:'plannedquantity',title:'计划数量',type:'int',width:110,require:true,align:'left'},
                       {field:'Plannedtarttime',title:'计划开始时间',type:'datetime',width:150,require:true,align:'left'},
                       {field:'State',title:'订单状态',type:'int',width:110,require:true,align:'left'},
                       {field:'craft',title:'工艺线路',type:'string',width:110,require:true,align:'left'},
                       {field:'alreadyproduced',title:'已经生产',type:'string',width:110,require:true,align:'left'},
                       {field:'unqualifiedquantity',title:'不合格数量',type:'int',width:110,require:true,align:'left'},
                       {field:'CreateTime',title:'创建时间',type:'datetime',width:150,require:true,align:'left'}];
    const detail ={columns:[]};
    const details = [];

    return {
        table,
        key,
        tableName,
        tableCNName,
        newTabEdit,
        editFormFields,
        editFormOptions,
        searchFormFields,
        searchFormOptions,
        columns,
        detail,
        details
    };
}